package cn.wolfcode.luowowo.article.query;

import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class TravelQuery extends QueryObject{
    private Long destId = -1L;
    //出行天数
    private int dayType = -1;

    //月份
    private int travelTimeType = -1;

    //人均
    private int perExpendType = -1;

    //排序
    private int orderType = 1;

    public String getOrderBy(){
        return orderType == 1? "t.createTime" : "t.viewnum";
    }


    //页面出入的dayType = 2转换成想要的范围对象
    public TravelCondition getDays(){
        return TravelCondition.DAYSMAP.get(dayType);
    }
    //月份
    public TravelCondition getTravelTime(){
        return TravelCondition.TIMEMAP.get(travelTimeType);
    }
    //人均
    public TravelCondition getPerExpend(){
        return TravelCondition.PRE_EXPENDSMAP.get(perExpendType);
    }



}
